<?xml version="1.0" encoding="ISO-8859-2" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions"
	xmlns:p="http://primefaces.org/ui">

<h:head>

</h:head>
<h:body>
	<h:form id="form">
		<p:dataTable var="c" value="#{countryService.cities}" 
			sortBy="#{c.district}" >
			
			<p:column id="Name" headerText="${resourceBundle.name}">  
	            	#{c.name}  
	        </p:column>
	
			<p:column id="District" headerText="${resourceBundle.district}">  
	            	#{c.district}  
	        </p:column>
	        
	        <p:column headerText="${resourceBundle.population}">  
	            	#{c.population}  
	        </p:column>
	        
	        <p:summaryRow listener="#{countryService.calculateTotal( c.district ) }" >
				<p:column colspan="2" style="text-align:right">  
	               ${resourceBundle.total}:
	           </p:column>
	
				<p:column>  
	                #{countryService.total}
	            </p:column>
			</p:summaryRow>
		</p:dataTable>
	</h:form>
</h:body>
</html>
